package T7_join;
public class T7_join_2 {    
    public static void main(String[] args) {    
        Thread t1 = new MyThread1();    
        t1.start();    
        for (int i = 0; i < 20; i++) {    
        	System.out.println("主线程第" + i + "次执行！");    
        	if (i > 2) try {    
        		t1.join();    
        	} catch (InterruptedException e) {    
        		e.printStackTrace();    
        	}    
        }    
    }    
}    
class MyThread1 extends Thread {    
	public void run() {    
        for (int i = 0; i < 10; i++) {    
        	System.out.println("线程1第" + i + "次执行！");    
        }    
	}    
}  


